package yang.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * HospitalOffice entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "hospital_office", catalog = "hospital")
public class HospitalOffice implements java.io.Serializable {

	// Fields

	private Integer ofId;//科室ID
	private String ofFunction;//科室作用
	private String ofName;//科室名称
	private Set<HospitalUser> hospitalUsers = new HashSet<HospitalUser>(0);

	// Constructors

	/** default constructor */
	public HospitalOffice() {
	}

	/** minimal constructor */
	public HospitalOffice(Integer ofId) {
		this.ofId = ofId;
	}

	/** full constructor */
	public HospitalOffice(Integer ofId, String ofFunction, String ofName,
			Set<HospitalUser> hospitalUsers) {
		this.ofId = ofId;
		this.ofFunction = ofFunction;
		this.ofName = ofName;
		this.hospitalUsers = hospitalUsers;
	}

	// Property accessors
	@Id
	@Column(name = "of_id", unique = true, nullable = false)
	public Integer getOfId() {
		return this.ofId;
	}

	public void setOfId(Integer ofId) {
		this.ofId = ofId;
	}

	@Column(name = "of_function", length = 200)
	public String getOfFunction() {
		return this.ofFunction;
	}

	public void setOfFunction(String ofFunction) {
		this.ofFunction = ofFunction;
	}

	@Column(name = "of_name", length = 200)
	public String getOfName() {
		return this.ofName;
	}

	public void setOfName(String ofName) {
		this.ofName = ofName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "hospitalOffice")
	public Set<HospitalUser> getHospitalUsers() {
		return this.hospitalUsers;
	}

	public void setHospitalUsers(Set<HospitalUser> hospitalUsers) {
		this.hospitalUsers = hospitalUsers;
	}

}